<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>



<%@ include file="/WEB-INF/jsp/partnerTools.jsp" %>


<H2>Country data </H2>

<h3> Last update: <c:out value="${updateTime}"/> ago </h3>


<br/>

<table class="searchTable">
	<form:form method="POST" commandName="countryDataSearchCriteria">

	<tr>	
		<td>
			Select sort criteria:
		</td>
		<td>
			<form:select path="sortCriteria">
				<form:options  itemLabel="name" />
			</form:select>
		</td>
		
	</tr>
	
	
	<tr>
		<td>
			Select alliance:
		</td>
		<td>
			<form:select path="alliance">
				<form:options itemLabel="name" />
			</form:select>
		</td>

	</tr>
	
	
	<tr>
		<td colspan="2">
			<center><input type="submit" value="Show"></center>
		</td>
	</tr>
	</form:form>
	
</table>




<%@ include file="/WEB-INF/jsp/commercials.jsp" %>





<table width="800" border="2" cellpadding="2" cellspacing="0" bordercolor="777777" width="600" style="text-align: center; font-size: 11px">

	<tr> 
		<td> Country</td> 
		<td> population </td> 
		<td> new citizens </td> 
		<td> online </td> 
		<td> treasure in gold </td> 
		<td> treasure in currency </td> 
	</tr>
		
	<c:forEach var="data" items="${countryData}" >
			<tr style="background: none repeat scroll 0% 0% <c:out value="${data.location.color}"/>;">
				<td> 
					<img src="<c:out value="${data.location.url}"/>"/><br/>
					<c:out value="${data.location.name}"/>
					<c:if test="${data.location.type == 'Country'}">
						(<c:out value="${data.country.alliance.name}"/>)
					</c:if>
				</td>
			
				<td>
					<c:out value="${data.population}"/><br/> 

					<a href="countryCharts.html?country=<c:out value="${data.location}"/>&attribute=POPULATION">charts</a>

				</td>
				
				<td> 
					<c:out value="${data.newCitizens}"/><br/>

					<a href="countryCharts.html?country=<c:out value="${data.location}"/>&attribute=NEW_CITIZENS">charts</a>
	
				</td>
	
				<td> 
					<c:out value="${data.online}"/><br/>
	
					<a href="countryCharts.html?country=<c:out value="${data.location}"/>&attribute=ONLINE">charts</a>
								
				</td>			
	
				<td> 
					<c:set var="goldTreasury"><fmt:formatNumber value="${data.goldTreasury}" maxFractionDigits="2"/></c:set>
					<c:out value="${goldTreasury}"/><img src="http://34all.org/erep/gold.gif"/><br/>
					
					<a href="countryCharts.html?country=<c:out value="${data.location}"/>&attribute=TREASURE_IN_GOLD">charts</a>
		
				</td>
				
				<td> 
					<c:set var="currencyTreasury"><fmt:formatNumber value="${data.currencyTreasury}" maxFractionDigits="2"/></c:set>
					
					<c:out value="${currencyTreasury}"/> <c:out value="${data.location.currencyName}"/><br/>
		
					<a href="countryCharts.html?country=<c:out value="${data.location}"/>&attribute=TREASURE_IN_CURRENCY">charts</a>
						
				</td>
				
			</tr>
	</c:forEach>
		
		
</table>



<%@ include file="/WEB-INF/jsp/bottom.jsp" %>

